using System;
using NUnit.Framework;
using PropertyExpression.Common;
using PropertyExpression.ControllableQuery;

namespace PropertyExpression.PwsApplication
{
    [TestFixture]
    public class QueryCheckTest
    {
        [Test]
        public void ClearDatabaseQuery()
        {
            ControllableQuery.Test.QueryCheck.MainTest.CheckNonQueries(
                MainTest.ConnectionString,
                context => new ClearDatabaseQuery()
                );
        }

        [Test]
        public void InsertSellerQuery()
        {
            ControllableQuery.Test.QueryCheck.MainTest.CheckNonQueries(
                MainTest.ConnectionString,
                context => new InsertSellerQuery(
                                    context.CreateParam<Guid>()
                                    )
                );
        }

        [Test]
        public void InsertBuyerQuery()
        {
            ControllableQuery.Test.QueryCheck.MainTest.CheckNonQueries(
                MainTest.ConnectionString,
                context => new InsertBuyerQuery(
                                    context.CreateParam<Guid>()
                                    )
                );
        }

        [Test]
        public void InsertQuotationHeaderQuery()
        {
            ControllableQuery.Test.QueryCheck.MainTest.CheckNonQueries(
                MainTest.ConnectionString,
                context => new InsertQuotationHeaderQuery(
                                    context.CreateParam<Guid>(),
                                    context.CreateParam<IOptionalValue<Guid>>(),
                                    context.CreateParam<IOptionalValue<Guid>>()
                                    )
                );
        }
    }
}